// import axios from 'axios'
import axios from '@/libs/api.request'

// const tempUrl = 'https://www.easy-mock.com/mock/5add9213ce4d0e69998a6f51/iview-admin/'
export default class user {
  static login = ({ userName, password }) => {
    return axios.request({
      // url: '/account/login',
      url: '/account/ClientLogin',
      data: {
        UserName: userName,
        Password: password
      },
      method: 'post',
      enctype: 'multipart/form-data'
    })
  }
  // vx登录
  static vxLogin = (headers) => {
    return axios.request({
      url: '/User/GetUser',
      headers: headers,
      method: 'get'
    })
  }
  // 根据账号密码进行第三方应用登陆授权
  static axLoginOauth (params) {
    return axios.request({
      url: '/account/LoginOauth',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }
  // 根据Token进行第三方应用登陆授权
  static axLoginTokenOauth (params) {
    return axios.request({
      url: '/account/TokenOauth',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 根据安薪税接口校验用户是否有效并登陆VXHRO
  static LoginAxsUser (params) {
    return axios.request({
      url: '/account/LoginAxsUser',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  //
  static CheckAllowLogin (params) {
    return axios.request({
      url: '/User/CheckAllowLogin',
      method: 'get',
      params: params
    })
  }
}
